package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

func main() {
	testReader()
}

func testReader() {
	fileName1 := "./goyykfsz/files/blockchain.txt"
	// 打开文件
	file1, _ := os.Open(fileName1)
	defer file1.Close()
	// 创建缓冲区
	reader1 := bufio.NewReader(file1)
	fmt.Printf("%T\n", reader1)

	for {
		// 以\n为分隔符读取
		s1, err := reader1.ReadString('\n')
		fmt.Print(s1)
		if err == io.EOF {
			fmt.Println("读取完毕！")
			break
		}
	}

}
